/*
 * SimpleSystem.h
 *
 *  Created on: Nov 6, 2012
 *      Author: root
 */

#ifndef PLAYERSYSTEM_H_
#define PLAYERSYSTEM_H_

#include <map>

#include "SystemAble.h"

#include "Player.h"
#include "Packet.h"

class Server;

class PlayerSystem: public SystemAble<Server>
{
	std::map<int,PlayerPtr> _players;

public:
	PlayerSystem(Server * server);
	virtual ~PlayerSystem();

public:

	bool init();

	bool uninit();

public:

	void add_player(const PlayerPtr & player);

	PlayerPtr get_player(int id)const;

public:

	void on_simple_packet(const Packet & packet);

	void on_player_packet(const PlayerPtr & player,const Packet & packet);
};

#endif /* PLAYERSYSTEM_H_ */
